﻿{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">编辑销售分单 [ <a href="__APP__/Order/detail/id/{$vo.order_id}">返回列表</a> ]
<div class="btn-group pull-right">
	<a class="btn btn-primary" href="__APP__/Message/add/obj_type/Order_detail/depart/销售/obj_id/{$vo.id}/return_type/Order_detail/return_id/{$vo.id}"><i class="icon-comment icon-white"></i> 创建备注</a>
	<a class="btn btn-primary" href="__URL__/full_edit/id/{$vo.id}"><i class="icon-edit icon-white"></i> 超级编辑</a>
</div>

  </h3>
<div id="result" class="result none"></div>


<table cellpadding=3 cellspacing=3 style="float:left">
	<form class="form-horizontal well" method='post' id="form1" action="__URL__/update/" >
<tr>
	<td class="tRight" >销售单号：</td>
	<td class="tLeft" >{$vo.mano}</td>
</tr>
<tr>
	<td class="tRight" >经办人：</td>
	<td class="tLeft" >
            {$vo.user_id|getModelName=User}&nbsp;&nbsp; &nbsp;&nbsp;创建时间：{$vo.create_time|toDate}
        </td>
</tr>
<tr>
	<td class="tRight" >产品：</td>
	<td class="tLeft" >
            {$vo.product_id|getPfullName} &nbsp; {$vo.product_id|getCas}
        </td>
</tr>
<tr>
	<td class="tRight" >规格：</td>
	<td class="tLeft" >{$vo.specification|getModelName="Specification"}
         <eq name="vo.status" value="0">  {:modList( 'Specification',$vo['specification'],'span2','specification' )}</eq>
        </td>
</tr>
<tr>
	<td class="tRight" >单价：</td>
	<td class="tLeft" > 
         <eq name="vo.status" value="0"><input id="" type="text" name="price" value="{$vo.price}" />
             <else/>{$vo.price}
         </eq></td>
</tr>
<tr>
	<td class="tRight" >数量：</td>
	<td class="tLeft" >{$vo.number} {$vo.product_id|getProductUnit}
        </td>
</tr>
<tr>
	<td>小计</td><td>{$vo.total} {$vo.order_id|getModelName='Order','currency'|getConfigVal='currency'}</td>
</tr>
<tr>
	<td class="tRight" >运费</td>
	<td class="tLeft" >
            <input type="text" value="{$vo.logifee}" name="logifee">
        </td>
</tr>
<tr>
	<td class="tRight" >总计</td>
	<td class="tLeft" >
           {:$vo['logifee']+$vo['total']}
        </td> </tr>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<tr>
	<td class="tRight" >要求交货期：</td>
	<td class="tLeft" >
            <input type="text" value="{$vo.delivery_date|toDate='Y-m-d'}" name="delivery_date" onClick="WdatePicker()">
        </td>
</tr>
<tr>
	<td class="tRight" >优先级</td>
	<td class="tLeft" >
			{:configList( C('Priority'),$vo['priority'],'priority' )}
            <a class="btn btn-primary" href="javascript:void(0)" onclick="urge_order({$vo.id})">客户催单</a>
        </td>
</tr>
<tr>
	<td class="tRight" >成本：</td>
	<td class="tLeft" >{$vo.cost}</td>
</tr>
<tr>
     <td>结算方式</td>
     <td>{:configList(C('settle_method'),$vo['settle_method'],'settle_method')}
     </td>
 </tr>
 
<tr>
	<td class="tRight" >预付款：</td>
	<td class="tLeft" >
            <input type="text" value="{$vo.to_first_pay}" name="to_first_pay">
        </td>
</tr>
<tr>
	<td class="tRight" >余款</td>
	<td class="tLeft" >
            {$vo.to_remain_pay}
        </td>
</tr>
<tr>
	<td class="tRight" >应收款</td>
	<td class="tLeft" >
            {$vo.should_pay}
        </td>
</tr>
<tr>
	<td class="tRight" >实收预付款：</td>
	<td class="tLeft" >
            {$vo.first_pay}
        </td>
</tr>
<tr>
	<td class="tRight" >实收余款</td>
	<td class="tLeft" >
            {$vo.remain_pay}
        </td>
</tr>
<tr>
	<td class="tRight" >实际付款</td>
	<td class="tLeft" >
            {$vo.real_pay}
        </td>
</tr>
<tr>
    <td>收款状态</td>
    <td>{$vo.receipt_status|getConfigVal='receiptStatus'}</td>
</tr>
<tr>
    <td>出库质量控制</td>
    <td>{$vo.qc_status|getConfigVal='qcStatus'}</td>
</tr>
<tr>
	<td>状态</td><td>
<eq name='vo.status' value='-1'>
            新订单，待审批
            <else/>
           	 {$vo.status|getConfigVal="orderDetailStatus"}
</tr>
<tr>
	<td></td>
	<td class="center" width="600">
		<input type="hidden" value="__APP__/Order/detail/id/{$vo.order_id}" name="jumpUrl">
        <input type="hidden" value="{$vo.id}" name="id">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
	<button type="reset" onclick="javascript:history.back()" class="btn btn-primary offset1"><i class="icon-arrow-left icon-white"></i> 返回</button>
	<lt name="vo.status" value="6">
		<a href="javascript:void(0)"  onclick="cancel_order({$vo.id})" class="offset1 btn btn-primary" >取消订单</a>	
 	</lt>
        </eq>
      </td>
</tr>
</form>
</table>

	<table class="table table-bordered" style="float:right">
	<tr><td colspan=5>订单备注</td>
		<td><a class="btn btn-primary" href="__APP__/Message/add/obj_type/Order_detail/depart/销售/obj_id/{$vo.id}/return_type/Order_detail/return_id/{$vo.id}"><i class="icon-comment icon-white"></i> 创建备注</a></td> 
	</tr>
	<tr> <td>编号</td><td>部门</td><td>留言</td><td>操作人</td>	<td>日期</td><td>修改</td> </tr>
	<!--order by create time desc-->
	<volist name="msgs" id="msg">
		<eq	name="_SESSION[C('USER_AUTH_KEY')]" value="$msg.user_id">	
			<form action="__APP__/Message/update" method="post" id="msg"
			<tr>
				<td> <input type="hidden" name="id" value="{$msg.id}">
					<input type="hidden" name="jumpUrl" value="__SELF__">
					{$msg.id}</td>
				<td>{$msg.depart}</td>
				<td><textarea name="content" class="input-xxlarge" rows="4">{$msg.content}</textarea> </td>
				<td>{$msg.user_id|getModelName='User'}</td>
				<td>{$msg.create_time|toDate}</td>
				<td> <input type="submit" class="btn btn-primary" value="修改"> </td>
			</tr>
			</form>
		<else/>
		<tr>
			<td>{$msg.id}</td>
			<td>{$msg.depart}</td>
			<td>{$msg.content}</td>
			<td>{$msg.user_id|getModelName='User'}</td>
			<td>{$msg.create_time|toDate}</td>
			<td> ---</td>
		</tr>
	</eq>
	</volist>
</table>


</div>
</div>

<!-- 主页面结束 --><include file="Public:footer"/>
<script type="text/javascript">
    function cancel_order(id){
        if (window.confirm('确定取消订单吗？'))
        {
            location.href=URL+"/cancel_order/id/"+id;
        }else
          return false;
    }
    function urge_order(id){
        if (window.confirm('确定客户催单吗？'))
        {
            location.href=URL+"/urge_order/id/"+id;
        }else
          return false;
    }
</script>

